<template>
	<view class="positionInfo">
		<view class="menu-list">
			<view class="list-cell">
				<view class="menu-item-box">
					<view>职位名称</view>
					<view class="text-right">{{responseInfo.name}}</view>
				</view>
			</view>
			<view class="list-cell">
				<view class="menu-item-box">
					<view>医院名称</view>
					<view class="text-right">{{responseInfo.hospitalDO.name}}</view>
				</view>
			</view>
			<view class="list-cell">
				<view class="menu-item-box">
					<view>薪资</view>
					<view class="text-right">{{responseInfo.miniSalary}}-{{responseInfo.maxSalary}}</view>
				</view>
			</view>
			<view class="list-cell">
				<view>
					<view>职位简介</view>
					<view class="description">{{responseInfo.description}}</view>
				</view>
			</view>
			<view class="list-cell">
				<view>
					<view>任职要求</view>
					<view class="description">{{responseInfo.jobRequire}}</view>
				</view>
			</view>
		</view>
		
		<view class="positionInfo-bottom">
			<button type="primary" @click="doDelivery()">投递简历</button>
		</view>
		
	</view>
</template>

<script>
	import {
		getRecruitmentPositionGet,
		createRecruitmentResumeDelivery
	} from "@/api/hospital/star.js"

	export default {
		data() {
			return {
				positionId: '',
				responseInfo: {}
			}
		},
		onLoad(event) {
			// if (event.id) {
			// 	console.log("kk:" + event.id)
			// }

			this.positionId = event.id;
			this.init();
		},
		methods: {
			init() {
				getRecruitmentPositionGet({
					"id": this.positionId
				}).then(response => {
					console.log(response)
					this.responseInfo = response.data;
				})
			},
			doDelivery(){
				createRecruitmentResumeDelivery({
					"positionId": this.positionId
				}).then(response => {
					console.log(response);
					
					uni.showToast({
						title: '简历已递交',
						icon: 'none'
					})
				})
			}
		}
	}
</script>

<style lang="scss">
.positionInfo{
	.description{
		margin-top: 10px;
		color: #999999;
	}
	
		
	.positionInfo-bottom{
		margin: 15px;
	}
}
</style>